<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2019/3/16
 * Time: 15:11
 */

namespace app\api\controller\v1;

use app\api\validate\IDMustBeInt;
use app\api\model\Banner as BannerModel;
use app\lib\exception\BannerMissException;
use think\Exception;

class Banner
{

    public function getBanner($id)
    {
        (new IDMustBeInt())->goCheck();
        $banner=BannerModel::getBannerByID($id);
        if(!$banner)
        {
            throw new BannerMissException();
        }
        return ($banner);

    }
}